/*去选座*/
var myLine=[
    {
        src:"../images/shiguang.png",
        mySpan1:"时光网",
        mySpan2:"&nbsp;&nbsp;&nbsp;￥58.0"
    },
    {
        src:"../images/gewara.png",
        mySpan1:"格瓦拉",
        mySpan2:"&nbsp;&nbsp;&nbsp;￥42.0"
    },
    {
        src:"../images/wangyi.png",
        mySpan1:"网易电影",
        mySpan2:"￥37.5"
    },
    {
        src:"../images/maoyan.png",
        mySpan1:"猫眼电影",
        mySpan2:"￥35"
    },
    {
        src:"../images/dazhong.png",
        mySpan1:"大众点评",
        mySpan2:"￥27"
    },
];

/*去团购*/
var myLine2=[
    {
        src:"../images/meituan.png",
        mySpan1:"美团网",
        mySpan2:"&nbsp;&nbsp;&nbsp;￥29.9"
    },
    {
        src:"../images/nuomi.png",
        mySpan1:"百度糯米",
        mySpan2:"￥19.9"
    },
    {
        src:"../images/dazhong.png",
        mySpan1:"大众点评",
        mySpan2:"￥32"
    },
    {
        src:"../images/taobaodianying.png",
        mySpan1:"淘宝电影",
        mySpan2:"￥27"
    }
];



window.onload=function(){
    for(i = 0; i < myLine.length; i++){
        new imgDiv(myLine[i]).addChild();
    }
    for(j = 0; j < myLine2.length; j++){
        new imgDiv2(myLine2[j]).addChild();
    }
}

function imgDiv(obj){
    this.src=obj.src;
    this.mySpan1=obj.mySpan1;
    this.mySpan2=obj.mySpan2;
}

function imgDiv2(obj){
    this.src=obj.src;
    this.mySpan1=obj.mySpan1;
    this.mySpan2=obj.mySpan2;
}

imgDiv.prototype.addChild=function(){
    var myUl=document.getElementById("myul");
    this.content="<div class='listDiv' style='width: 100%;float: left;background: white;margin-top: 2%;'>" +
    "<img style='width: 44px;height: 43px;padding: 2% 0 2% 5%;float: left;' src='"+this.src+"'>"+
    "<span style='float: left;padding: 5% 0 0 5%;fonts-size: 16px;color: #949494;'>"+this.mySpan1+"</span>"+
    "<span style='float: left;fonts-size: 18px;color: #fb5c5c;padding: 4% 0 0 8%;'>"+this.mySpan2+"</span>"+
    "<div style='padding: 2% 3% 2% 3%;margin-right: 2%;margin-top: 3%;background: white;border: 1px solid #ffc823;float: right;'>" +
    "<a style='color: #ffc823;'>去选座<i class='fa fa-angle-right' aria-hidden='true'></i></a>"+
    "</div>"+
    "</div>";
    myUl.innerHTML += this.content;
}

imgDiv2.prototype.addChild=function(){
    var myUl2=document.getElementById("myul2");
    this.content="<div class='listDiv' style='width: 100%;float: left;background: white;margin-top: 2%;'>" +
    "<img style='width: 44px;height: 43px;padding: 2% 0 2% 5%;float: left;' src='"+this.src+"'>"+
    "<span style='float: left;padding: 5% 0 0 5%;fonts-size: 16px;color: #949494;'>"+this.mySpan1+"</span>"+
    "<span style='float: left;fonts-size: 18px;color: #fb5c5c;padding: 4% 0 0 8%;'>"+this.mySpan2+"</span>"+
    "<div style='padding: 2% 3% 2% 3%;margin-right: 2%;margin-top: 3%;background: white;border: 1px solid #ffc823;float: right;'>" +
    "<a style='color: #ffc823;'>去团购<i class='fa fa-angle-right' aria-hidden='true'></i></a>"+
    "</div>"+
    "</div>";
    myUl2.innerHTML += this.content;
}
